//
//  CollectionViewCell.m
//  YiChat20160706
//
//  Created by 李政 on 16/7/11.
//  Copyright © 2016年 ZhiYou. All rights reserved.
//

#import "CollectionViewCell.h"



#define ITEM_WIDTH      (SCREEN_WIDTH - 50) * 1.0 /3

#define ITEM_SPACING    10

@implementation CollectionViewCell

- (void)awakeFromNib {
    // Initialization code
}



#pragma mark 属性的Set方法
- (void)setProgressValue:(float)progressValue
{
    //_.frame = CGRectMake(0, progressValue * HEIGHT, WIDTH, (1 - progressValue) * HEIGHT);
}


#pragma mark ASIProgressDelegate
- (void)setProgress:(float)newProgress
{
    
    //coverView.frame = CGRectMake(0, newProgress * HEIGHT, WIDTH, (1 - newProgress) * HEIGHT);
    
    self.top.constant = ITEM_WIDTH * newProgress;
    
    self.height.constant = ITEM_WIDTH * (1 - newProgress);
    
    [self.percentBtn setTitle:[NSString stringWithFormat:@"%.2f%%",newProgress * 100] forState:UIControlStateNormal];
    
}

@end
